import java.sql.SQLOutput;
import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[] args){
        int num = 0;
        int i = 1;
        while(i <= 10){
            System.out.println("请输入第"+i+"个数据（1-100）:>");
            Scanner scanner = new Scanner(System.in);
            int i = scanner.nextInt();
            if(num > 100){
                System.out.println("您输入的数据范围不在1-100，请重新输入");
                continue;
            }
            ++i;
        }
    }
//        short a = 128;
//        byte b = (byte)a;
//
//        System.out.println(a);
//        System.out.println(b);
//        double x = 2.0;
//        int y = 4;
//        int a = 3;
//        System.out.println(x/++y);
//        System.out.println("\\\"hello\\\"");
        //int count = nineCount();
        //System.out.println(count);
        //isRun1();
        //isSu();
       // int x = 5;
       // printAge(x);
       // game();
       //narcissusCount();
        //double num = fraction();
        //System.out.println(num);
        //int x = 10;
        //int y = 20;
        //int result = greatestCommonDivisor(x,y);
       // System.out.println(result);
        //integer(x);
//        int m = 1;
//        int n = 2;
//        int result = add(m,n);
//        System.out.println(result);
//        double a = 1.2;
//        double b = 2.3;
//        double c = 3.4;
//        double result1 = add(a,b,c);
//        System.out.println(result1);
//            int a=1;
//            int b=2;
//            int c=3;
//            int max=max3(a,b,c);
//            System.out.println(max);
//
//
//    }
    //求最大值
    public static int max2(int x,int y) {
        if(x > y){
            return x;
        }else{
            return y;
        }
    }
    public static int max3(int a,int b,int c){
        int z = max2(a,b);
        if(z > c){
            return z;
        }else {
            return c;
        }
    }
    //求最大值方法的重载
    public static int max(int x,int y){
        if(x > y){
            return x;
        }else{
            return y;
        }
    }
    public static double max(double x,double y){
        if(x > y){
            return x;
        }else{
            return y;
        }
    }
    //求和的重载
    public static int add(int x,int y){
        return x+y;
    }
    public static double add(double x,double y,double z){
        return x+y+z;
    }
    // 编写程序数一下 1到 100 的所有整数中出现多少个数字9
    public static int nineCount(){
        int count = 0;
        for(int i = 1;i <= 100;++i) {
            if(i%10==9){
                count++;
            }
            if(i/10==9){
                count++;
            }
        }
        return count;
    }
    // 打印闰年
    public static void isRun(){
        int x = 1000;
        for(;x <= 2000;++x){
            if(x%100 == 0){
                if(x%400 == 0){
                    System.out.println(x+"是一个世纪闰年");
                }else{
                    System.out.println(x+"不是世纪闰年");
                }
            }else{
                if(x%4 == 0){
                    System.out.println(x+"是一个普通闰年");
                }else{
                    System.out.println(x+"不是闰年");
                }
            }
        }
    }
    //打印闰年
    public static void isRun1(){
        for(int i=1000;i<=2000;++i){
            if((i%100!=0 && i%4 == 0) || i%400 == 0){
                System.out.print(i+" ");
            }
        }
    }
    //判断素数
    public static void isSu(){
        boolean flag = true;
        for(int i=2;i<=100;++i){
            for(int j=2;j<i;++j){
                if(i%j == 0){
                    flag = false;
                    break;
                }
            }
            if (flag){
                System.out.println(i);
            }
            flag = true;
        }

    }
    //判断素数
    public static void judjeSu(int x){
        boolean flag = true;
        for (int i=2;i<x;++i){
            if(x%i == 0){
                flag = false;
                break;
            }
            if(flag){
                System.out.println(x+"是一个素数");
            }else {
                System.out.println(x+"不是素数");
            }
        }
    }
    //打印年纪
    public static void printAge(int x) {
        if (x <= 18) {
            System.out.println("少年");
        } else if (x > 18 && x <= 28) {
            System.out.println("青年");
        } else if (x > 28 && x <= 55) {
            System.out.println("中年");
        } else if (x > 55) {
            System.out.println("老年");
        }
    }
    public static void game(){
        Random random = new Random();
        Scanner sc = new Scanner(System.in);
        int toGuess = random.nextInt(100);
        while(true){
            System.out.println("请输入一个数字：");
            int num = sc.nextInt();
            if(num < toGuess){
                System.out.println("猜小了");
            }else if(num > toGuess){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了");
            }
        }
    }
    //水仙花数
    public static void narcissusCount(){
        for(int i=100;i<1000;++i){
            if(((i/100)*(i/100)*(i/100) + (i%100/10)*(i%100/10)*(i%100/10) + (i%10)*(i%10)*(i%10)) == i){
                System.out.println(i);
            }
        }
    }
    public static double fraction(){
        int flag = 1;
        double num = 0.0;
        for(int i=1;i <= 100;++i){
            num += flag*(1.0/i);
            flag = -flag;
        }
        return num;
    }
    //最大公约数
    public static int greatestCommonDivisor(int x,int y){
        int top;
        if(x>y){
            top = y;
        }else{
            top = x;
        }
        for(int i=top;i>2;--i){
            if((x%i)==0 && (y%i)==0){
                return i;
            }
        }
        return 1;
    }
    //输出一个整数的每一位
    public static void integer(int x){
        int count = 1;
        int tmp = x;
        while(tmp!=0){
            count *= 10;
            tmp /= 10;
        }
        while (x != 0){
            System.out.println(x/count);
            count /= 10;
            x /= 10;
        }
    }

}


